package com.xej.seat.handle;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import com.xej.seat.core.service.CusSeatFoctory;
import com.xej.seat.vo.Customer;

/**
 * 职级算法
 * @author lisheng
 */
public class CusLevelHandle implements CusSeatFoctory {

	@Override
	public void createCus(List<Customer> list) {
		Collections.sort(list, new Comparator<Customer>(){  
            public int compare(Customer c1, Customer c2) {  
              
                if(c1.getCusLevel() > c2.getCusLevel()){  
                    return 1;  
                }  
                if(c1.getCusLevel() == c2.getCusLevel()){  
                    return 0;  
                }  
                return -1;  
            }  
        });   
	}
	
}
